package io2;

import java.io.*;
import java.nio.charset.StandardCharsets;

public class BRDemo {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("pw.txt");
        InputStreamReader isr = new InputStreamReader(fis, StandardCharsets.UTF_8);
        BufferedReader br = new BufferedReader(isr);
        String s;//不能写String s = br.readLine();因为这表示只读取第一行
        while ((s=br.readLine())!= null) {
            System.out.println(s);
        }
        System.out.println("读取完毕");
        br.close();
    }
}
